<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Promise.reject方法: (reason) => {}
        // (1) reason: 失败的原因
        // 说明: 返回一个失败的promise对象(PromiseState值为rejected)
        // 注意：若没有处理则会直接报错。

        // 返回一个失败的promise对象,其中Promise.PromiseResult值为参数内容
        const p1 = Promise.reject("执行失败");
        // 相当于
        //const p2 = new Promise((resolve,reject) => { reject("执行失败"); })

        console.log(p1);
        //console.log(p2);

        //p1.then(v=>{},e=>{console.log(e);});
        p1.catch(reason => {
            console.log(reason);
        })

     
    </script>
</body>
</html>